The bug found in the presentation that we forgot to review has been fixed
[RRRRHHHH_Code] / ruralHouses client / src / gui / OffersRelatedOwnerGUI.java
index fe2d073..23cfb85 100644 (file)
@@ -3,6 +3,8 @@ package gui;
 import java.awt.Frame;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
 
 import javax.swing.GroupLayout;
 import javax.swing.GroupLayout.Alignment;
@@ -11,6 +13,9 @@ import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.border.EmptyBorder;
 
+import common.HouseInterface;
+
+import configuration.___IntNames;
 import domain.Owner;
 
 public class OffersRelatedOwnerGUI extends JFrame {
@@ -35,7 +40,21 @@ public class OffersRelatedOwnerGUI extends JFrame {
                JButton btnCreateOffers = new JButton("Create Offers");
                btnCreateOffers.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent arg0) {
-                               Frame a = new AddOffersGUI(owner.getRuralHouses());
+                               HouseInterface houseM=null;
+                               try {
+                                       houseM = (HouseInterface) Naming
+                                                       .lookup(___IntNames.HouseManager);
+                               } catch (Exception e1) {
+                                       System.out.println("Error accessing remote authentication: "
+                                                       + e1.toString());
+                               }
+                               Frame a = null;
+                               try {
+                                       a = new AddOffersGUI(houseM.getHouses(owner, null, null, 0, 0, 0, 0, 0));
+                               } catch (RemoteException e) {
+                                       // TODO Auto-generated catch block
+                                       e.printStackTrace();
+                               }
                                a.setVisible(true);
                        }
                });